class Solution:
    def minimumAddedCoins(self, coins: List[int], target: int) -> int:
        coins.sort()
        ans,s,i=0,1,0
        while s<=target:
            if i<len(coins) and coins[i]<=s:
                s+=coins[i]
                i+=1
            else:
                s*=2
                ans+=1
        return ans
